package org.gd.hellojson.locale;

import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.ObjectWriter;

import java.io.IOException;
import java.util.UUID;

/**
 * @author Gorhover
 * @version 1.0-SNAPSHOT
 * @since 2013-11-07 18:17
 */
class App {

    public static void main(String[] args) throws IOException {
        ObjectMapper mapper = new ObjectMapper();
        MessageSourceStdSerializerProvider provider = new MessageSourceStdSerializerProvider(UUID.randomUUID().toString(), mapper);
        mapper.setSerializerProvider(provider);

        ObjectWriter writer = mapper.writerWithDefaultPrettyPrinter();
        System.out.println(writer.writeValueAsString(user()));
    }

    private static User user() {
        User user = new User();
        user.setId(10);
        user.setName("name");
        return user;
    }
}
